package caip2024p.rcv3;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 输入 n
        int n = scanner.nextInt();
        int a = 0, b = 0;

        // 循环输入 x 并统计
        for (int i = 1; i <= n; i++) {
            int x = scanner.nextInt();
            if (x < 0) {
                a++;
            } else {
                b++;
            }
        }

        // 输出较小的值
        System.out.println(Math.min(a, b));

        // 关闭 Scanner
        scanner.close();
    }
}